home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1997 September / Macworld (1997-09).dmg / Shareware World / Comms & Internet / Mail*Link SMTP⁄QM Installer / Disk 3 / Sources & Scripts / Scripts / passwd.script < prev    next >
Text File  |  1989-05-17  |  949b  |  29 lines

  1. :
  2. cut -f1 -d":" /etc/passwd > /tmp/file1$$
  3. cut -f5 -d":" /etc/passwd > /tmp/file2$$
  4. cut -f1 -d" " /tmp/file2$$ > /tmp/temp1$$
  5. cut -f2 -d" " /tmp/file2$$ > /tmp/temp2$$
  6. num_lines=`wc -l /tmp/file1$$ | sed "s/[ ]*\([0-9]*\).*/\1/"`
  7. while ( test $num_lines -gt 0 )
  8. do
  9.         echo '"' >> /tmp/quotes0$$
  10.         echo '"' >> /tmp/quotes1$$
  11.         echo '"' >> /tmp/quotes2$$
  12.         echo '"' >> /tmp/quotes3$$
  13.         echo ',' >> /tmp/comma$$
  14.         echo '    ' >> /tmp/tab$$
  15.         echo "`hostname`" >> /tmp/hostname$$
  16.         echo '@' >> /tmp/at$$
  17.         num_lines=`expr $num_lines - 1`
  18. done
  19. paste -d'\0' /tmp/quotes0$$ /tmp/temp2$$ /tmp/comma$$ \
  20. /tmp/temp1$$ /tmp/quotes1$$ /tmp/tab$$ /tmp/quotes2$$ \
  21. /tmp/file1$$ /tmp/at$$ /tmp/hostname$$ \
  22. /tmp/quotes3$$ | grep -v '","'
  23.  
  24. rm -f /tmp/quotes0$$ /tmp/temp2$$ /tmp/comma$$ \
  25. /tmp/temp1$$ /tmp/quotes1$$ /tmp/tab$$ /tmp/quotes2$$ \
  26. /tmp/hostname$$ /tmp/at$$ /tmp/file1$$ /tmp/quotes3$$ \
  27. /tmp/file2$$
  28.  
  29.